﻿using System;
using System.Collections.Generic;
using System.Text;

using System.Xml.Schema;
using System.Xml.Serialization;

namespace FireEagleNet
{
	[XmlRoot("location-hierarchy")]
	[Serializable]
	public class LocationHierarchy
	{
		private Location[] m_locations = new Location[0];
		private Location m_bestguess;

		[XmlElement("location", Form = XmlSchemaForm.Unqualified)]
		public Location[] LocationCollection
		{
			get { return m_locations; }
			set
			{
				m_locations = value == null ? new Location[0] : value;
				foreach (Location l in m_locations)
				{
					if (l.isBestGuess) m_bestguess = l;
				}
			}
		}

		public Location BestGuess
		{
			get
			{
				return m_bestguess;
			}
		}

	}
}
